import mongoose from "mongoose";

export enum ArticleOperation {
  SetPending = 0,
  SetPublished = 1,
  SetFrozen = 2,
  SetDeleted = -1
}

export const articleLogSchema = new mongoose.Schema({
  create_at: {
    type: Date,
    default: Date.now
  },
  article: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "Article",
    required: true
  },
  create_by: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "Admin",
    required: true
  },
  operation: {
    type: Number,
    required: true
  }
});
